#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <bitset>
#include <utility>
using namespace std;

const double eps = 1e-6;
const int INF = 0x3f3f3f3f;

typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<int, LL> PIL;

inline void quickread() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
}

int r, g, b;

string radix(int n, int r) {
    string res = "";
    int mod = n % r;
    if (mod >= 10) res += mod - 10 + 'A';
    else res += mod + '0';

    n /= r;
    if (n >= 10) res += n - 10 + 'A';
    else res += n + '0';
    reverse(res.begin(), res.end());
    return res;
}

inline void solution() {
    string res = "";
    cin >> r >> g >> b;
    res += radix(r, 13);
    res += radix(g, 13);
    res += radix(b, 13);
    cout << "#" << res << endl;
    return ;
}

int main() {
    freopen("input.txt", "r", stdin);
    quickread();
    solution();
    return 0;
}
